
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2508. -- 简单题 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2508: 简单题</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>512 MBSec&nbsp;&nbsp;<span class=red>Special Judge</span><br><span class=green>Submit: </span>72&nbsp;&nbsp;<span class=green>Solved: </span>31<br>[<a href='submitpage.php?id=2508'>Submit</a>][<a href='problemstatus.php?id=2508'>Status</a>][<a href='bbs.php?id=2508'>Discuss</a>]</center><h2>Description</h2><div class=content><div style="text-indent: 21pt"><span style="font-size: medium">求一个点使得它到平面上<b><u>所有直线距离平方和</u></b>最小。</span></div>
<div style="text-indent: 21pt"><span style="font-size: medium">你需要实现以下3种操作：</span></div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -18pt"><span style="font-size: medium">1.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>平面上加入一条直线；</span></div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -18pt"><span style="font-size: medium">2.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>删除一条已加入的直线；</span></div>
<div style="margin: 0cm 0cm 0pt 60pt; text-indent: -18pt"><span style="font-size: medium">3.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>求一个点到平面上所有直线距离平方和最小，你需要输出这个最小值。</span></div></div><h2>Input</h2><div class=content><div style="text-indent: 21pt"><span style="font-size: medium">第1行包含一个整数<i>N</i>，表示了操作数目。接下来<i>N</i>行操作属于下列3种格式之一：</span></div></div><h2>Output</h2><div class=content><div><span style="font-size: medium">输出行数等于查询操作的次数，每行输出每次查询操作所要求的最小值，保留两位小数。</span></div>
<div><span style="font-size: medium">&nbsp;</span></div></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>10<br />
0 0.0 0.0 1.0 0.0<br />
2<br />
0 0 1 1 1<br />
2<br />
0 0 2 1 2<br />
2<br />
1 2<br />
2<br />
1 3<br />
2<br />
 <br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>0.00<br />
0.50<br />
2.00<br />
2.00<br />
0.00<br />
 <br />
【数据规模与约定】<br />
对于10%的数据，N ≤ 25；<br />
对于50%的数据，N ≤ 1000；<br />
对于50%的数据，查询操作不超过10次；<br />
对于70%的数据，N ≤ 20000；<br />
对于100%的数据，N ≤ 120000。<br />
 </span></div><h2>HINT</h2>
			<div class=content><p><p>鸣谢Kac提供SPJ</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=2011福建集训'>2011福建集训</a></p></div><center>[<a href='submitpage.php?id=2508'>Submit</a>][<a href='problemstatus.php?id=2508'>Status</a>][<a href='bbs.php?id=2508'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
